<template>
    <div class="demo-box">
        <div>test-main</div>
        <img class="image" alt="Demo" src="@/static/images/bg_liaoning.png">
        <el-button type="primary">主要按钮</el-button>
        <el-button type="primary" size="small" @click="handleClick">click</el-button>

        <div>  
            <p>语言测试</p>
            <p>{{ $t('commons.admin') }}</p>
        </div>
        <div>
            <el-select v-model="value">
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
            </el-select>
        </div>
    </div>
</template>
<script>
    import { mapActions } from 'vuex';
    import { getTest, addTest, addJson, addForm } from '@/api/index';
    export default {
        data () {
            return {
                value: null,
                options: [{
                    value: '选项1',
                    label: '黄金糕'
                }, {
                    value: '选项2',
                    label: '双皮奶'
                }, {
                    value: '选项3',
                    label: '蚵仔煎'
                }, {
                    value: '选项4',
                    label: '龙须面'
                }, {
                    value: '选项5',
                    label: '北京烤鸭'
                }],
            }
        },
        methods: {
            ...mapActions('menu', {
                setLeftCollapseMenu: 'setLeftCollapse'
            }),
            ...mapActions('test', ['setLeftCollapse', 'handleOther']),
            handleClick() {
                this.setLeftCollapse();
                this.handleOther();
                this.setLeftCollapseMenu();
                console.log(this.$store)
            },
            requestTest() {
                getTest({cs: 'cs', test: null}).then(res => {})
                addTest({cs: 'cs', test: null}).then(res => {})
                addJson({cs: 'cs', test: null}).then(res => {})

                let formdata = new FormData();
                formdata.append('cs', 'cs');
                formdata.append('test', 'test');
                addForm(formdata).then(res => {})
            }
        },
        created() {
            console.log(this.$webConfig);
            console.log(this.$store);
            this.requestTest()
        }
    }
</script>
<style lang="less" scoped>
    .image {
        width: 500px;
    }
</style>
<style lang="scss" scoped>
    .demo-box {
        background-color: #ccc;
        height: 600px;
    }
</style>